package com.chen.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo<T> {
    public String code;
    public String message;

    public T data;

    public static <T> ResultVo<T> success(String message, T data) {
        return new ResultVo<T>("200", message, data);
    }

    public static <T> ResultVo<T> error(String message) {
        return new ResultVo<T>("500", message, null);
    }

}
